package com.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MyController {

    @RequestMapping("/test")
    public String test(){
        return "a";
    }

    @RequestMapping("url1/{data}")
    @ResponseBody
    public void url1(@PathVariable String data){
        System.out.println(data);
    }
    @RequestMapping("url2/{data}")
    @ResponseBody
    public void url2(@PathVariable("data") String msg){
        System.out.println(msg);
    }
    @RequestMapping("url3/{data}/url3")
    @ResponseBody
    public void url3(@PathVariable("data") String msg){
        System.out.println(msg);
    }
    @RequestMapping("url4/{a}/{b}/{c}")
    @ResponseBody
    public void url4(@PathVariable String a,@PathVariable String b,@PathVariable String c){
        System.out.println("data:"+a+"="+b+"="+c);
    }

}
